package com.zr.java8.fun;

import java.util.function.Supplier;

public class SupplierDemo {
    public static void main(String[] args) {
        //TODO 没有参数，只有返回值
        Supplier<String> supplier = new Supplier<String>() {
            @Override
            public String get() {
                return "1024";
            }
        };

        System.out.println(supplier.get());

        //lambda表达式
        Supplier<String> supplier1 = () -> "1024";
        System.out.println(supplier1.get());

    }
}
